import { ElLoading } from 'element-plus'

export function useLoading() {
  let loading
  function open() {
    loading = ElLoading.service({
      lock: true,
      text: '加载中...',
      background: 'rgba(0, 0, 0, 0.5)',
    })
  }
  function close() {
    loading?.close()
  }
  return { open, close }
}
